﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using JXPlatform.Demo.ViewModels;
using JXPlatform.GIS.Views;
using JXPlatform.Infrastructure;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.ServiceLocation;

namespace JXPlatform.Demo.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    [Export]
    public partial class Shell
    {
        [ImportingConstructor]
        public Shell(IRegionManager regionManager)
        {
            if (regionManager == null)
            {
                return;
            }

            InitializeComponent();

            RegionManager.SetRegionName(layoutDocumentPane, RegionNames.MainRegion);
            RegionManager.SetRegionManager(layoutDocumentPane, regionManager);

            regionManager.RegisterViewWithRegion(RegionNames.MainRegion, typeof (MapView));
        }

        [Import]
        public ShellViewModel ShellViewModel
        {
            get { return DataContext as ShellViewModel; }
            set { DataContext = value; }
        }
    }
}
